<template>
    <div class="itemMusictop">
        <img :src="playlist.coverImgUrl" alt="" class="bgimg" />
        <div class="top-top">
            <div class="item-left">
                <span @click="$router.go(-1)">
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-zuojiantou-copy"></use>
                    </svg>
                </span>
                <span class="text">歌单</span>
            </div>
            <div class="item-righ">
                <span
                    ><svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-sousuo-copy"></use></svg
                ></span>
                <span
                    ><svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-caidan-copy"></use></svg
                ></span>
            </div>
        </div>
        <div class="top-content mt-4">
            <div class="avatar">
                <img :src="playlist.coverImgUrl" alt="" />
                <p class="item-text">{{}}</p>
                <div class="play-count">
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-play25_play"></use>
                    </svg>
                    {{ filters(playlist.playCount) }}
                </div>
            </div>
            <div class="details pl-3 d-flex flex-column jc-between">
                <div class="d-top fs-xl">{{ playlist.name }}</div>
                <div class="d-content">
                    <div
                        class="uploder d-flex ai-center"
                        v-if="playlist.creator"
                    >
                        <span class="">
                            <img :src="playlist.creator.avatarUrl" alt="" />
                        </span>
                        <span class="ml-1"
                            >{{ playlist.creator.nickname }} &gt;</span
                        >
                    </div>
                </div>
                <div class="d-footer fs-sm text-grey-2">
                    关于歌单: {{ playlist.description }}
                </div>
            </div>
        </div>
        <div class="top-footer d-flex jc-around pt-3  mt-1">
            <div class="footer-items">
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-xiaoxi-copy-copy"></use>
                </svg>
                <div>{{ playlist.commentCount }}</div>
            </div>
            <div class="footer-items">
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-fenxiang-copy"></use>
                </svg>
                <div>{{playlist.shareCount}}</div>
            </div>
            <div class="footer-items">
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-xiazai-wenjianxiazai-07-copy"></use>
                </svg>
                <div>下载</div>
            </div>
            <div class="footer-items">
                <svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-xuanze-duoxuan-tianchong-copy"></use>
                </svg>
                <div>多选</div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name: "ItemMusicTop",
    props: ["playlist"],
    methods: {
        //数字转化
        filters(value) {
            if (value > 100000000) {
                return (value / 100000000).toFixed(1) + "亿";
            }
            if (value > 10000) {
                return (value / 10000).toFixed(1) + "万";
            }
        },
    },
};
</script>

<style lang="less" scoped>
.itemMusictop {
    color: white;
    .bgimg {
        z-index: -1;
        position: absolute;
        width: 100%;
        height: 6rem;
        filter: blur(30px);
    }
    padding: 0.1rem;
    .top-top {
        height: 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .item-left,
        .item-righ {
            width: 2rem;
            display: flex;
            justify-content: space-between;
        }
        span {
            &.text {
                font-size: 0.4rem;
            }
            display: inline-block;
            .icon {
                width: 0.5rem;
                height: 0.5rem;
            }
        }
    }
    .top-content {
        display: flex;
        padding: 0 0.1rem;
        .avatar {
            position: relative;
            .play-count {
                top: 0;
                right: 0.3rem;
                position: absolute;
                color: white;
                margin-top: 0.1rem;
                .icon {
                    height: 0.3rem;
                    width: 0.3rem;
                }
            }
            img {
                height: 2.6rem;
                width: 130px;
                border-radius: 0.2rem;
            }
        }
        .details {
            .d-top {
                font-weight: 700;
            }
            .uploder {
                img {
                    width: 0.6rem;
                    border-radius: 50%;
                }
            }
            .d-footer {
                //                 display: -webkit-box; 必须结合的属性 ，将对象作为弹性伸缩盒子模型显示 。
                // -webkit-box-orient 必须结合的属性 ，设置或检索伸缩盒对象的子元素的排列方式 。
                // text-overflow: ellipsis;，可以用来多行文本的情况下，用省略号“…”隐藏超出范围的文
                height: 0.6rem;
                overflow: hidden;
                text-overflow: ellipsis;
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
            }
        }
    }
    .top-footer {
        .icon {
            height: 0.6rem;
            width: 0.6rem;
        }
    }
}
</style>